{% extends "miramar/base.html" %}
{% load i18n %}
{% load miramar_tags %}

{% block title %}{{ page.title|escape }}{% endblock %}
{% block content_title %}<h1>{{ page.title|escape }}</h1>{% endblock %}
{% block pretitle %}
{% if not pageversion.approved %}
<div class="system-message">
    <p>This version of {{ page.title|escape }} is not currently approved for 
    publishing.</p>
</div>
{% else %}
{% ifnotequal page.published_version pageversion %}
<div class="system-message">
	<p>This version of {{ page.title|escape }} is not currently published.</p>
</div>
{% endifnotequal %}
{% endif %}
{% endblock %}
{% block content %}
{% block object-tools %}
<ul class="object-tools">
  {% if user|has_perm:"miramar.change_page" %}
    <li><a href="{% url miramar_page_update page.slug %}">{% trans "Update this page" %}</a></li>
  {% endif %}
 </ul>
{% endblock %}
{% render_markup pageversion %}
<br style="clear: both;" />
{% if user|has_perm:"miramar.change_page" %}
<table class="module">
  <caption>{% trans "Version data" %}</caption>
  <thead>
    <tr>
      <th>{% trans "Last editor" %}</th>
  	  <th>{% trans "Last edited" %}</th>
      <th>{% trans "Comment" %}</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="mailto:{{ pageversion.author.email }}">{{ pageversion.author.username }}</a></td>
      <td>{{ pageversion.time_stamp|date:'N j, Y P' }}</td>
      <td>{% if pageversion.comment.strip %}{{ pageversion.comment }}{% else %}<em>{% trans "No comment provided." %}</em>{% endif %}</td>
    </tr>
  </tbody>
</table>
{% endif %}
{% endblock %}
